package com.example.myapplication.model;

import java.io.Serializable;

public class Review implements Serializable {
    private String reviewer;
    private int rating;
    private String comment;
    private String time;
    private int likeCount;

    public Review(String reviewer, int rating, String comment, String time, int likeCount) {
        this.reviewer = reviewer;
        this.rating = rating;
        this.comment = comment;
        this.time = time;
        this.likeCount = likeCount;
    }
    // 兼容旧用法
    public Review(String reviewer, int rating, String comment) {
        this(reviewer, rating, comment, "", 0);
    }
    public Review(String reviewer, int rating, String comment, int likeCount) {
        this(reviewer, rating, comment, "", likeCount);
    }
    public String getReviewer() { return reviewer; }
    public int getRating() { return rating; }
    public String getComment() { return comment; }
    public String getTime() { return time; }
    public int getLikeCount() { return likeCount; }
    public void setLikeCount(int likeCount) { this.likeCount = likeCount; }
    public void setTime(String time) { this.time = time; }
    public void addLike() { this.likeCount++; }
}
